package com.security.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.security.entity.Role;
import com.security.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhuchao
 * @since 2021-03-27
 */
@Repository
public interface UserMapper extends BaseMapper<User>  {

//	@Select("select * from user where username  LIKE CONCAT('%',#{username},'%')")
	@Select("select * from user where username  = #{username}")
	User findUserByUsername(@Param("username") String username);

	@Select("select * from role where name  = #{name}")
	List<Role> findRoleByUsername(String name);
}
